<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');

    $router->any('files/uploads', 'FileController@handle');
    $router->any('files/ueditor/uploads', 'UeditorUploadController@handler');

    // 首页
    $router->get('settings/pageindex', 'WxSettingController@index_pageindex');
    $router->post('settings/pageindex', 'WxSettingController@index_pageindex');
    $router->post('settings/action/pageindex', 'WxSettingController@pageindex');

    // 发现页
    $router->get('settings/pagefind', 'WxSettingController@index_pagefind');
    $router->post('settings/pagefind', 'WxSettingController@index_pagefind');
    $router->post('settings/action/pagefind', 'WxSettingController@pagefind');

    // 搜索页
    $router->get('settings/pagesearch', 'WxSettingController@index_pagesearch');
    $router->post('settings/pagesearch', 'WxSettingController@index_pagesearch');
    $router->post('settings/action/pagesearch', 'WxSettingController@pagesearch');

    // 发布配置
    $router->get('settings/publish', 'WxSettingController@index_publish');
    $router->post('settings/publish', 'WxSettingController@index_publish');
    $router->post('settings/action/publish', 'WxSettingController@publish');

    // 圈子配置
    $router->get('settings/circle', 'WxSettingController@index_circle');
    $router->post('settings/circle', 'WxSettingController@index_circle');
    $router->post('settings/action/circle', 'WxSettingController@circle');


    // 笔记配置
    $router->get('settings/post', 'WxSettingController@index_post');
    $router->post('settings/post', 'WxSettingController@index_post');
    $router->post('settings/action/post', 'WxSettingController@post');

    // 广告配置
    $router->get('settings/ad', 'WxSettingController@index_ad');
    $router->post('settings/ad', 'WxSettingController@index_ad');
    $router->post('settings/action/ad', 'WxSettingController@ad');


    // 安全配置
    $router->get('settings/safe', 'WxSettingController@index_safe');
    $router->post('settings/safe', 'WxSettingController@index_safe');
    $router->post('settings/action/safe', 'WxSettingController@safe');

    // 板块
    $router->resource('plate', 'WxPlateController');
    // 圈子
    $router->resource('circle', 'Circle\WxCircleController');
    // 文章
    $router->resource('posts/index', 'Posts\WxPostController');
    // 评论
    $router->resource('commen', 'Posts\WxCommentController');

    // 用户
    $router->resource('users', 'User\WxUserController');
    $router->resource('slideshow', 'WxSlideshowController');
    // 图标
    $router->resource('settings/icons', 'WxIconController');
    // 问答
    $router->resource('qa/question', 'WxQuestionController');

    $router->resource('student_certify', 'User\WxUserStudentCertifyController');

    $router->resource('/universities', 'WxUniversityController');

    $router->get('/select/universities', 'WxUniversityController@universities');

});
